#include "newpasswordsure.h"
#include "ui_newpasswordsure.h"

newPasswordSure::newPasswordSure(const QString &originPassword, QWidget *parent) :
    QDialog(parent),
    ui(new Ui::newPasswordSure),
    originalPassword(originPassword)
{
    ui->setupUi(this);


}

newPasswordSure::~newPasswordSure()
{
    delete ui;
}

void newPasswordSure::on_newAgainEPushButton_clicked()
{
    QString newAgainPassword = ui->newAgainPLineEdit->text();

    if(newAgainPassword.isEmpty())
    {
        QMessageBox::warning(this, "错误", "密码不能为空");
        return;
    }

    //验证密码一致性
    if(originalPassword != newAgainPassword)
    {
        QMessageBox::warning(this, "错误", "两次输入的密码不一致");
        return;
    }

    accept();


}
